<form action="index.php?option=com_questionare" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
   
     <?php foreach($this->ques as $k=>$row){?>
      
      <table class="table-suvery" border=0>
         <?php
            $model = $this->getModel(); 
            $this->ans = $model->getAnwser($row->QUES_CODE);
            $this->allAns = $model->getTotalAns($row->QUES_CODE);
            
            $this->countAns = 0;
            if($row->QUES_TYPE == 1 || $row->QUES_TYPE == 2){
         ?>
         <tr>
            <td colspan="5" style="text-align: left;">
                 <label>
                    <?php echo ++$this->countQues.'. '.$row->QUES_TITLE ;?>
                </label>
            </td>
         </tr>
          <tr>
            <td style="width: 15%; text-align: right; padding-right: 15px;">
               
            </td>
            <td style="width: 25%;"></td>
            <td style="width: 10%" ><label>回答回数 (%)</label></td>
            <td style="width: 10%"><label>回答回数 (n)</label></td>
            <td></td>
         </tr>
         <?php foreach($this->ans as $k=>$v):?>
        
         <tr>
              <td style="width: 15%; text-align: right; padding-right: 15px;">
                <?php echo  ++$this->countAns.'. '.$v->ANSQ_VALUE ;?>
              </td>
              <td style="width: 25%;" >
                <div class="div-outter">
                    <div class="div-inner" style="width: <?php if($model-> getAns($row->QUES_CODE,$v->ANSQ_CODE) > 0){ echo round(($model-> getAns($row->QUES_CODE,$v->ANSQ_CODE)*100/$this->allAns),2); } else echo 0;?>%;">
                        
                    </div>
                </div>
              </td>
              <td style="width: 10%" > 
                <?php if($model-> getAns($row->QUES_CODE,$v->ANSQ_CODE) > 0){ echo round(($model-> getAns($row->QUES_CODE,$v->ANSQ_CODE)*100/$this->allAns),2); } else echo 0;?>
              </td>
              <td style="width: 10%" >
                <?php echo $model-> getAns($row->QUES_CODE,$v->ANSQ_CODE); ?>
              </td>
              <td>
              </td>
        </tr>
        
        <?php endforeach ?>
        <tr>
            <td></td>
            <td></td>
            <td>レスポンス合計</td>
            <td><?php echo $this->allAns; ?></td>
            <td></td>
        </tr>
      
      <br />
    <?php  }else{ ?>
          <tr>
            <td colspan="2" style="width: 40%;text-align: left;">
                 <label>
                    <?php echo ++$this->countQues.'. '.$row->QUES_TITLE ;?>
                </label>
            </td>
            <td style="width: 10%">レスポンス合計</td>
            <td style="width: 10%"><?php echo $this->allAns; ?></td>
            <td></td>
         </tr>
         <br />
    <?php
        }
    } ?>
    </table>
<div>
		<input type="hidden" name="task" value="">
		<input type="hidden" name="boxchecked" value="0">
        <input type="hidden" name="cid" id="cid" value="<?php echo JRequest::getVar('cid')?>"/>
</form>